BIN = ./
SRC1 = ./src
SRC2 = ./tinyxml
SRC3 = ./

INC = -I$(SRC1) -I$(SRC2) -I$(SRC3) -I./include
OBJ = ./obj


SOURCE = $(wildcard ${SRC1}/*.cpp) $(wildcard ${SRC2}/*.cpp) $(wildcard ${SRC3}/*.cpp) 
OBJECT = $(patsubst %.cpp,${OBJ}/%.o,$(notdir ${SOURCE}))


TARGET = liboffice_check.so
BIN_TARGET = ${BIN}/${TARGET}

CC = g++ 
CFLAGS = -g -w ${INC} -std=c++11 -D ZIP_STD -D _ICONV_SUPPORT
LDLIBS = -lrt -shared -ldl -fPIC

${BIN_TARGET}:${OBJECT}
	$(CC) -o $@ ${OBJECT} $(LDLIBS) $(LIBS)
	
${OBJ}/%.o:${SRC1}/%.cpp
	$(CC) $(CFLAGS) -o $@ -c $< $(LDLIBS) $(LIBS)
${OBJ}/%.o:${SRC2}/%.cpp
	$(CC) $(CFLAGS) -o $@ -c $< $(LDLIBS) $(LIBS)
${OBJ}/%.o:${SRC3}/%.cpp
	$(CC) $(CFLAGS) -o $@ -c $< $(LDLIBS) $(LIBS)

#.PHONY:clean
clean:
	find $(OBJ) -name *.o -exec rm -rf {} \;
	rm -rf $(BIN_TARGET)



